﻿<SwapChainBackgroundPanel
    x:Class="RK.Store.MetroSnake.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RK.Store.MetroSnake"
    xmlns:localui="using:RK.Store.MetroSnake.UI"
    xmlns:commonui="using:RK.Common.WinRT.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tk="using:WinRTXamlToolkit.Controls"
    mc:Ignorable="d">

    <!-- Uncomment this to visualize statndard grid measures -->
    <!--<commonui:StandardGridMeasuresView />-->
    <localui:SnappedViewOverlayControl x:Name="SnappedViewOverlay"
                                       Visibility="Collapsed" />

    <Grid x:Name="MainContentGrid"
          Height="140" VerticalAlignment="Top" Margin="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- Define title bar-->
        <StackPanel Name="ToolBar"
                    Orientation="Vertical"
                    Grid.Row="0" Height="140"
                    VerticalAlignment="Top">

            <!-- Define Title panel-->
            <Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="1"
                               VerticalAlignment="Center"
                               Margin="0,26,0,0"
                               Style="{StaticResource PageHeaderTextStyle}"
                               Text="{StaticResource ResourceKey=AppName}" />
                </Grid>

                <!-- Title panel on right side -->
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Right"
                            Margin="0,0,60,0" Height="140">
                    <TextBlock
                        x:Uid="MainScreenScore"
                        VerticalAlignment="Center"
                        Margin="0,34,0,10"
                        Style="{StaticResource PageHeaderTextStyle}"
                        Text="Score:" />
                    <TextBlock x:Name="m_txtPoints"
                        VerticalAlignment="Center"
                        Margin="20,26, 0, 0"
                        Style="{StaticResource PageHeaderTextStyle}"
                        Text="{Binding Points}" />
                </StackPanel>
            </Grid>
        </StackPanel>

        <!-- Define dummy grid containing frame for navigation content-->
        <Grid Grid.RowSpan="2"
              Width="NaN" Height="NaN">
            <Frame Name="MainFrame"
                   Width="NaN" Height="NaN"
                   Visibility="Collapsed" />
        </Grid>
    </Grid>

    <!-- Define the AppBar -->
    <AppBar Height="100" VerticalAlignment="Bottom"
            Name="AppBar" Opened="OnAppBarOpened"
            Background="#00CBFF">
        <Grid>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <Button x:Uid="MainScreenRestart"
                        Name="CmdRestart"
                        Click="OnCmdRestartClick"
                        Style="{StaticResource RestartGameAppBarButtonStyle}" />
            </StackPanel>

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Button x:Uid="MainScreenHighscore"
                        Name="CmdHighScore"
                        Style="{StaticResource HighscoreAppBarButtonStyle}"
                        Click="OnCmdHighscoreClick" />
                <Button x:Uid="MainScreenMoreInfo"
                        Name="CmdHelp"
                        Style="{StaticResource HelpAppBarButtonStyle}"
                        Click="OnCmdHelpClick" />
            </StackPanel>
        </Grid>
    </AppBar>
</SwapChainBackgroundPanel>